package com.xctech.ipb.module.user.controller;

import com.xctech.ipb.common.vo.Result;
import com.xctech.ipb.module.user.domain.entity.UserDo;
import com.xctech.ipb.module.user.domain.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/")
public class IndexController {

    @Autowired
    private UserService userService;

    @GetMapping("/test")
    public String index() {
        return "hello world";
    }

    @GetMapping("/user")
    public Result<UserDo> getUser() {
        return Result.success(userService.getUserInfo());
    }
}
